package org.realteam.hibernate.test.model.inheritance;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.SecondaryTable;
import javax.persistence.SecondaryTables;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;

@Entity
@Table(name = "EMPLOYEE")
@SecondaryTables({
	@SecondaryTable(name = "EMP_HR", pkJoinColumns = {
		@PrimaryKeyJoinColumn(name = "EMP_HR_KEY")
	}),
	@SecondaryTable(name = "EMP_CLASS", pkJoinColumns = {
		@PrimaryKeyJoinColumn(name = "EMP_CLASS_KEY")
	})
})
public class Employee implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(generator = "hilo", strategy = GenerationType.IDENTITY)
	@GenericGenerator(name = "hilo", strategy = "hilo")
	private Long empId;
	
//	@EmbeddedId
//	private EmployeePK primaryKey;
	
	private String empName;
	
	@Column(table = "EMP_HR")
	private Float empSalary;
	
	@Column(table = "EMP_CLASS")
	private Integer empClass;
	
	@Type(type = "EmployeeStatus")
	private EmployeeStatus status;
	
	@Type(type = "SalaryRate")
	private SalaryRate payScale;
	
	public SalaryRate getPayScale() {
		return payScale;
	}

	public void setPayScale(SalaryRate payScale) {
		this.payScale = payScale;
	}

	public EmployeeStatus getStatus() {
		return status;
	}

	public void setStatus(EmployeeStatus status) {
		this.status = status;
	}

	public Integer getEmpClass() {
		return empClass;
	}

	public void setEmpClass(Integer empClass) {
		this.empClass = empClass;
	}

	public Long getEmpId() {
		return empId;
	}

	public void setEmpId(Long empId) {
		this.empId = empId;
	}

	public String getEmpName() {
		return empName;
	}

	public void setEmpName(String empName) {
		this.empName = empName;
	}

	public Float getEmpSalary() {
		return empSalary;
	}

	public void setEmpSalary(Float empSalary) {
		this.empSalary = empSalary;
	}

//	public EmployeePK getPrimaryKey() {
//		return primaryKey;
//	}
//
//	public void setPrimaryKey(EmployeePK primaryKey) {
//		this.primaryKey = primaryKey;
//	}
	
}
